|
|
|
|
|
|
|
There are two types of FTP servers: public and private. Public servers are open to anyone; private servers won't let you log on unless you're a verified user of the server. Either way, the FTP protocol requires that you supply a user name and a password, which authenticates users and allows or prevents access. |
|
|
|
|
|
|
|
|
To log on to public servers, the common practice is to log on as anonymous (UserName = anonymous) and send your email name as the password. This process is simplified even further with the Internet Transfer control. By default, if you don't supply UserName and Password property values, the control sends anonymous as your UserName and your email name for the Password. It gets both pieces of information from your PC's Registry settings. If you're logging on to a private server, simply set the required UserName, Password, and URL properties, and invoke the Execute method, as follows: |
|
|
|
|
|
|
|
|
With Inet1
.URL = ftp://ftp.someFTPSite.com
.UserName = John Smith
.Password = mAuI&9$6
.Execute ,DIR
.Execute ,CLOSE
End With |
|
|
|
|
|
|
|
|
After you invoke the Execute method, the FTP connection will remain open. You can then continue to use the Execute method to perform other FTP operations, such as CD and GET. After you finish, close the connection by using the Execute method with the CLOSE operation. You also can close the connection automatically by changing the URL property and invoking the OpenURL or Execute method, which will close the current FTP connection and open a new one. |
|
|
|
|
|
|
|
|
Caution If you set the URL property last, the UserName and Password properties will be set to blanks. Set the URL property before you set any other properties of the File Transfer control. |
|
|
|
|
|
|
|
|
|
Although Visual Basic 5 provides you with everything you need to access the Internet, to fully understand and use the Internet, you should learn two other languages that bring things together: Hypertext Markup Language (HTML) and VBScript. HTML, the formatting language behind Web pages, is designed to achieve two purposes: |
|
|
|
|
|
|
|
|
Format Web pages in columns with graphics and appropriate titles |
|
|
|
|
|
|
|
|
Allow the integration of additional Internet service programs, such as VB ActiveX documents and Java (a small programming language that activates Web pages) |
|
|
|
|
|